#ifndef FACEDETECTOR_H
#define FACEDETECTOR_H

#include <QObject>
#include <QVector>
#include <QImage>
#include <QMetaType>

#include "Face.h"

#include <opencv/cv.h>

class ObjectDetector;

class FaceDetector : public QObject
{
    Q_OBJECT
public:
    explicit FaceDetector(float faceScale = 0.275f, QObject *parent = 0);

signals:
    void detectedFaces(QVector<Face> faces);

public slots:
    QVector<Face> detectFaces(QImage image);

private:
    QVector<QRect> findEyes(QRect face, IplImage* image);

    ObjectDetector* faceDetector;
    ObjectDetector* leftEyeDetector;
    ObjectDetector* rightEyeDetector;
    ObjectDetector* eyeGlassesDetector;
    ObjectDetector* eyePairBigDetector;
    ObjectDetector* eyeDetector;
    ObjectDetector* noseDetector;
    ObjectDetector* mouthDetector;
};

#endif // FACEDETECTOR_H
